package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.dto.NursingPageDTO;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 护理项目接口
 */
@RestController
@Slf4j
@RequestMapping("/member/orders/project")
@Api(tags = "护理项目")
public class NursingProjectMemberController extends BaseController {
    @Resource
    private INursingProjectService iNursingProjectService;

    /**
     * 分页查询护理项目列表
     *
     * @param nursingPageDTO
     * @return
     */
    @ApiOperation("分页查询护理项目列表")
    @GetMapping("/page")
    public TableDataInfo page(NursingPageDTO nursingPageDTO) {
        return iNursingProjectService.pageProject(nursingPageDTO);
    }

    /**
     * 根据编号查询护理项目信息
     *
     * @param id
     * @return
     */
    @ApiOperation("根据编号查询护理项目信息")
    @GetMapping("/{id}")
    public AjaxResult getById(@PathVariable Long id) {
        return AjaxResult.success(iNursingProjectService.getById(id));
    }



}
